package com.etc.service.impl;

import com.etc.entity.Hospital;
import com.etc.mapper.HospitalMapper;
import com.etc.service.HospitalService;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class HospitalServiceImpl implements HospitalService {
    @Autowired
    private HospitalMapper hospitalMapper;

    public Hospital queryById(int id) { return hospitalMapper.queryById(id); }
    public List<Hospital> queryBy(String text) {
        return hospitalMapper.queryBy(text);
    }
    public List<Hospital> queryAll() { return hospitalMapper.queryAll(); }
    public List<Hospital> queryByArea(int area){return hospitalMapper.queryByArea(area);}
    public void deleteById(int id) { hospitalMapper.deleteById(id);}
    public void insertHospital(@Param("id") int id, @Param("name") String name, @Param("site") String site, @Param("area") int area) {
        hospitalMapper.insertHospital(id,name,site,area);
    }
    public void updateHospital(Hospital hospital) {
        hospitalMapper.updateHospital(hospital);
    }
}
